{	Problem: http://codeforces.ru/problemset/problem/52/A
	Verdict: Accepted

}
var a,b,c,k,i,n:integer;
begin
readln(n);
a:=0;
b:=0;
c:=0;
for i:=1 to n do begin
  read(k);
  if k=1 then inc(a) else
  if k=2 then inc(b) else inc(c);
end;
if (a>=b) and (a>=c) then writeln(b+c) else
if (b>=a) and (b>=c) then writeln(a+c) else writeln(a+b);
end.